package com.zts.base.exception;

import org.springframework.context.MessageSource;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

/**
 * Created by lily on 2017/6/7.
 */
@ResponseStatus(HttpStatus.UNPROCESSABLE_ENTITY)
public class UnprocessableEntityException extends ServiceException {

    private static final String DEFAULT_CODE = CommonExceptionCode.UNPROCESSABLE_ENTITY;

    public UnprocessableEntityException() {
        super(DEFAULT_CODE);
        setCode(DEFAULT_CODE);
    }

    public UnprocessableEntityException(String message, Object... args) {
        super(message, args);
        setCode(DEFAULT_CODE);
    }

    public UnprocessableEntityException(Throwable cause) {
        super(cause, DEFAULT_CODE);
        setCode(DEFAULT_CODE);
    }

    public UnprocessableEntityException(Throwable cause, String message, Object... args) {
        super(cause, message, args);
        setCode(DEFAULT_CODE);
    }

    public UnprocessableEntityException(MessageSource messageSource, Object... args) {
        super(messageSource, DEFAULT_CODE, args);
    }

    public UnprocessableEntityException(Throwable cause, MessageSource messageSource, Object... args) {
        super(cause, messageSource, DEFAULT_CODE, args);
    }
}